<template>
   <div>
       <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newsList" :key="item.id"> 
					<router-link :to="'/home/newsinfo/'+item.id">
						<img class="mui-media-object mui-pull-left" :src="item.img">
						<div class="mui-media-body">
							<b>{{item.name}}</b>
							<p class='mui-ellipsis'>
                                <span>{{item.time}}</span>
                                <span>{{item.click}}</span>
                            </p>
						</div>
					</router-link>
				</li>
			</ul>
   </div>
</template>
<script>
import {Toast} from 'mint-ui'
export default{
    data(){
        return {
            // newList:[]
            newsList:[
                {id:1, name:'幸福',time:'发表时间：2012-12-20 23:56',click:'点击：315次',img:'https://avatar.gitee.com/uploads/49/5290649_Shaoyouqing.png!avatar30?1568185684'},
                {id:2,name:'木屋',time:'发表时间：2018-08-16 20:15',click:'点击：252次',img:'https://avatars0.githubusercontent.com/u/51347185?s=40&v=4'},
                {id:3,name:'CBD',time:'发表时间：2016-08-16 01:20',click:'点击：1414次',img:'https://avatars0.githubusercontent.com/u/51347185?s=40&v=4'},
                {id:4,name:'一辈子',time:'发表时间：2017-06-16 03:50',click:'点击：762次',img:'http://cdn2.jianshu.io/assets/default_avatar/4-3397163ecdb3855a0a4139c34a695885.jpg'},
                {id:5,name:'幸福',time:'发表时间：2010-11-22 15:20',click:'点击：315次',img:'https://avatar.gitee.com/uploads/49/5290649_Shaoyouqing.png!avatar30?1568185684'},
                {id:6,name:'木屋',time:'发表时间：2019-01-10 16:00',click:'点击：252次',img:'https://avatars0.githubusercontent.com/u/51347185?s=40&v=4'},
                {id:7,name:'CBD',time:'发表时间：2010-03-12 17.12',click:'点击：1414次',img:'https://avatars0.githubusercontent.com/u/51347185?s=40&v=4'},
                {id:8,name:'一辈子',time:'发表时间：2011-02-11 18.10',click:'点击：762次',img:'http://cdn2.jianshu.io/assets/default_avatar/4-3397163ecdb3855a0a4139c34a695885.jpg'}
            ]
        }
    },
    // created(){
    //     this.getNewsList();
    // },
    // methods:{
    //     getNewsList(){
    //         this.$http.get('api/getnewslist').then(result=>{
    //             if(result.body.status==0){
    //                 this.newList=result.body.message;
    //             }else{
    //                 Toast('获取失败')
    //             }
    //         })
    //     }
    // }
}
</script>
<style lang="scss" scoped>
    .mui-ellipsis{
        color:#226aff;
        display:flex;
        justify-content: space-between
    }
</style>